package main

import "gitee.com/wayjin/fabric-extension/contract"

type PartA struct {}
type PartB struct{}

type ContractAsset struct {
	Date  string
	Number  int64
	Context []byte
}

func (p PartA) MemberID() string { return "Org1MSP" }
func (p PartB) MemberID() string { return "Org2MSP" }

func (ca ContractAsset) Save(ctx *contract.Context) contract.Response {
	return contract.Response{State:200, Message:"SetNumber: TODO"}
}

func (ca ContractAsset) GetByNumber(ctx *contract.Context) contract.Response {
	ctx.GetID()
	return contract.Response{State:200, Message:"SetContext: TODO"}
}

func New() contract.Contract {
	return contract.Contract{
		Participants: map[string]contract.Participant{
			"partA": PartA{},
			"partB": PartB{},
		},
		Asset:map[string]contract.Asset{
			"myasset": ContractAsset{},
		},
	}
}

func main() {
	contract := New()
	contract.Deploy()
}